home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 659 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. From: yeager@aosi.com
  2. Message-ID: <4hqd3e$n7k@news.aosi.com>
  3. X-Original-Date: 8 Mar 1996 22:41:50 GMT
  4. Path: in2.uu.net!bounce-back
  5. Date: 08 Mar 96 03:53:35 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: 'const' in header files
  9. Organization: Advanced OnLine Services Inc.
  10. References: <AD5A0C5196681CA0D@sleipner.nts.mh.se> <31379F8F.7659@compuserve.com> <AD64B66E966816216@sleipner.nts.mh.se>
  11. Reply-To: yeager@aosi.com
  12. X-Newsreader: IBM NewsReader/2 v1.2.5
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBFAgUBMT+vZ+EDnX0m9pzZAQHougF+NyMxJQUThrV0tMcPj8eV8JCssvbLdtw0
  15.     mfiDsboFzurdRPpmT+jCwW2CCIJPl2OV
  16.     =ZUL9
  17.  
  18. In <AD64B66E966816216@sleipner.nts.mh.se>, lars.farm@nts.mh.se (Lars Farm)
  19. writes:
  20.  
  21. >I suggested that required behaviour was that these constants are not
  22. >instantiated unless actually used, much like templates. Rather than leaving
  23. >it as an optional optimization as it appears to be now. This should apply
  24. >to any built in type. Thus invalidating stupid warnings about unused
  25. >variables. If some compilers warn about this, and according to the thread
  26. >in c.l.c++.moderated some do, then many users will have to revert to the
  27. >#define style constants instead. Is that the intent of the language
  28. >designers?
  29.  
  30. One area where such a requirement conflicts with existing rules would
  31. be if the constant object has a constructor.  Then the existing rules
  32. would not allow the constant to be omitted since the constructor must
  33. be called (especially if it has detectable side effects) even if the
  34. constant is not used in the particular compilation unit.
  35.  
  36. John Yeager
  37. yeager@aosi.com
  38. ---
  39. [ To submit articles: try just posting with your news-reader.
  40.                       If that fails, use mailto:std-c++@ncar.ucar.edu
  41.   FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  42.   Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  43.   Comments? mailto:std-c++-request@ncar.ucar.edu.
  44. ]
  45.